import request from "@/utils/request";

//获取地域分布
export function getRegionApi(Params: any): Promise<ResType> {
    return request({
        url: '/SEMApi/China_Datas',
        method: "get",
        params: Params,
    });
}

//关键词排名
export function getKeywordRankApi(Params: any): Promise<ResType> {
    return request({
        url: "/SEMApi/SearchEngineRanking",
        method: "get",
        params: Params,
    });
}

//导出报表
export function exportKeywordRankApi(Params: any): Promise<ResType> {
    return request({
        url: "/SEMApi/GetSEMExcel",
        method: "get",
        params: Params,
    });
}

export function exportKeywordApi(data: any): Promise<ResType> {
    const formData = new FormData();
    formData.append("url", data.url);
    formData.append("submit", data.submit);
    return request({
        url: "/SEMApi/GetSEMExcel",
        method: "post",
        data: formData,
        headers: {
            "Content-Type": "multipart/form-data",
        },
    });
}

//获取来源分析
export function getSourceApi(Params: any): Promise<ResType> {
    return request({
        url: '/SEMApi/SourceDataChart',
        method: "get",
        params: Params,
    });
}

export function getSourceLineChartApi(Params: any): Promise<ResType> {
    return request({
        url: '/SEMApi/SourceLineCharts',
        method: "get",
        params: Params,
    });
}

//获取来源统计
export function getSourceStatisticsApi(Params: any): Promise<ResType> {
    return request({
        url: '/SEMApi/SumDataTotal',
        method: "get",
        params: Params,
    });
}

//获取流量分析线型图
export function getFlowAnalysisLineChartApi(Params: any): Promise<ResType> {
    return request({
        url: '/SEMApi/TrafficLineCharts',
        method: "get",
        params: Params,
    });
}

export function getFlowAnalysisApi(Params: any): Promise<ResType> {
    return request({
        url: '/SEMApi/TrafficDataCharts',
        method: "get",
        params: Params,
    });
}

//获取受访问页面
export function getInterviewPageApi(Params: any): Promise<ResType> {
    return request({
        url: '/SEMApi/WebUrlDataChart',
        method: "get",
        params: Params,
    });
}

//添加项目
export function addProjectApi(data: any): Promise<ResType> {
    return request({
        url: "/SEMApi/AddProject",
        method: "post",
        data: data,
    });
}

//获取项目
export function getProjectApi(): Promise<ResType> {
    return request({
        url: "/SEMApi/AddProjectView",
        method: "get",
    });
}